var focusT = focusI = imgCount = 0;
$(function(){
	var focusImage = $(".focus-img .img");
	imgCount = focusImage.size();
	//focusF();
	var focusT = setInterval(focusF,3000);
	$(".focus-img ul a").bind('click',loadFoucImg);
});

var focusF = function(){
	focusI >= (imgCount - 1) ? focusI=0 : focusI++;
    $(".focus-img .img").fadeIn().eq(focusI).fadeOut();
	$(".focus-img ul li").removeClass("cur").eq(focusI).addClass("cur");
}

var loadFoucImg = function(){
	clearInterval(focusT);
	focusT = setInterval(focusF,3000);
	var index = $(".focus-img ul a").index(this);
	focusI = index;
	$(".focus-img ul li").removeClass("cur").eq(index).addClass("cur");
	$(".focus-img .img").fadeIn().eq(index).fadeOut();
}